﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using LUStationery.Controller;
using LUStationery.Model;

public partial class Login : System.Web.UI.Page
{
    UsersControl usercont;
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void btnLogin_Click(object sender, EventArgs e)
    {
        string email = txtEmail.Text;
        string password = txtPassword.Text;
        Response.Write(password);
        usercont = new UsersControl();
        User u =usercont.getUserByEmail(email);
        string userpassword = u.Password;
        Session["user"] = u;
        if (userpassword == password)
        {
            Response.Redirect("Default.aspx");
        }
        else {
            Response.Write("Sorry");
        }


    }
}
